const express = require("express");
const app = express();
const router = express.Router();

const {mysql , executeQuery} = require("../../mysql");

router.post("/delete-user", async (req, res) => {
  let sql = `delete from ${req.body.col} where id='${req.body.id}';`;

  try {
    let result = await executeQuery(sql);
    res.json({
      res: typeof result == "object",
    });

  } catch (error) {
    console.error('Error executing query:', error);
    res.status(500).send('Internal Server Error');
  }
});
module.exports = router;
